package com.example.hasee.zhcd.Util;

import android.app.ProgressDialog;
import android.content.Context;

public class ProgressDialogUtils {

	private static ProgressDialog m_pDialog;
	
	/**
	 * 创建进度
	 * */
	public static void createProgressDialog(Context context,String message) {
		m_pDialog = new ProgressDialog(context);
		m_pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
		m_pDialog.setMessage(message);
		m_pDialog.setIndeterminate(false);
		m_pDialog.setCancelable(true);
		m_pDialog.show();
	}

	/**
	 * 创建进度
	 * */
//	public static void createProgressDialog(Context context) {
//		m_pDialog = new ProgressDialog(context);
//		m_pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
//		m_pDialog.setMessage(ZhGlobalConstant.Result.progressmesg);
//		m_pDialog.setIndeterminate(false);
//		m_pDialog.setCancelable(true);
//		m_pDialog.show();
//	}

	/**
	 * 隐藏进度
	 */
	public static void hideProgressDialog() {
		if (m_pDialog != null) {
			m_pDialog.hide();
		}
	}
	
	/**
	 * 显示进度
	 */
	public static void showProgressDialog() {
		if (m_pDialog != null) {
			m_pDialog.show();
		}
	}

	/**
	 * 关闭进度
	 * */
	public static void closeProgressDialog() {
		if (m_pDialog != null) {
			m_pDialog.dismiss();
		}
	}

}
